package se.webbzon.boltzmann.game.event;

import se.webbzon.oschi01.worldarea.WorldArea;
import se.webbzon.oschi01.worldobject.WorldObject;

public class DestroyEvent extends AbstractGameEvent {
	
	// The binding of this event
	private final WorldObject binding;
	
	/*============================================================
	Constructors
	============================================================*/
	
	public DestroyEvent(WorldObject binding) {
		this.binding = binding;
	}
	
	/*============================================================
	Public Methods
	============================================================*/

	@Override protected void onBegin(WorldArea world) {
		if (binding != null) {
			world.destroyInstance(binding);
		}
		end();
	}

	@Override protected void onEnd() {};

}
